<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('hazards', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('project_id')->default(0)->index();
            $table->string('title')->default('/')->comment('title');
            $table->string('type')->default('/')->comment('隐患类型');            
            $table->date('description_date')->nullable()->comment('排查日期');
            $table->string('description')->default('/')->comment('隐患描述');
            $table->string('rectification')->nullable()->default('/')->comment('整改措施');
            $table->date('rectification_date')->nullable()->comment('整改完成日期');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('hazards');
    }
};
